<?php

function rand_date($min_date, $max_date) {
    /* Gets 2 dates as string, earlier and later date.
       Returns date in between them.
    */

    $min_epoch = strtotime($min_date);
    $max_epoch = strtotime($max_date);
	
    $rand_epoch = rand($min_epoch, $max_epoch);
	
    return date('Y-m-d H:i:s', $rand_epoch);
}

$rand =  rand(1, 29);

$date1 = rand_date("2014-04-".$rand, "2014-04-".$rand);
$date2 = rand_date("2014-04-".$rand, "2014-04-".$rand+1);

if(strtotime($date1) < strtotime($date2)){
		echo $date1."<br>";
		echo $date2."<br>";
	} else { 
		
	}

class MyDB extends SQLite3 {
	function __construct() {
		$this->open('access.db');
	}
}

$db = new MyDB();

if(!$db) { 
		echo $db->lastErrorMsg();
}

for($i=1;$i<15+1;$i++) {
	
	$sql_access = "insert into access (uid, date) values ('15324dbe', '123')";
	/*
	
	*/
	
	//$results = $db->query($sql_access);
}

?>